# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1287518682.5683489
_template_filename='/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/source/index.html'
_template_uri='/derived/source/index.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['heading']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/base/index.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        url = context.get('url', UNDEFINED)
        c = context.get('c', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n\n')
        # SOURCE LINE 5
        __M_writer(u'\n\n<p class="descriptiveP">Sources are books or papers that can be referenced in the OLD.  A source may be associated to a File which is an electronic copy of the source.  Alterations to the list of sources will immediately affect the searching and adding of Forms and Collections.</p>\n\n<a href="')
        # SOURCE LINE 9
        __M_writer(escape(url(controller='source', action='add')))
        __M_writer(u'" class="buttonLink" title="Add a new source">Add</a>\n\n<div class="containerDiv">\n')
        # SOURCE LINE 12
        if c.sources:
            # SOURCE LINE 13
            __M_writer(u'<table class="clearTable">\n <thead>\n  <tr>\n   <td>ID</td>\n   <td>Author</td>\n   <td>Year</td>\n   <td>Title</td>\n  </tr>\n </thead>\n')
            # SOURCE LINE 22
            for source in c.sources:
                # SOURCE LINE 23
                __M_writer(u'  <tr>\n   <td class="clearTable">')
                # SOURCE LINE 24
                __M_writer(escape(source.id))
                __M_writer(u'</td>\n   <td><a href="')
                # SOURCE LINE 25
                __M_writer(escape(url(controller='source', action='view', id=source.id)))
                __M_writer(u'" class="link">')
                __M_writer(escape(source.authorLastName))
                __M_writer(u', ')
                __M_writer(escape(source.authorFirstName))
                __M_writer(u'</a></td>\n   <td>')
                # SOURCE LINE 26
                __M_writer(escape(source.year))
                __M_writer(u"</td>\n   <td><span class='emphasize'>")
                # SOURCE LINE 27
                __M_writer(escape(source.title))
                __M_writer(u'</span></td>\n  </tr>\n')
                pass
            # SOURCE LINE 30
            __M_writer(u'</table>\n')
            pass
        # SOURCE LINE 32
        __M_writer(u'</div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 3
        __M_writer(u'\n    <h1 class="heading">Sources</h1>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


